package com.demo.common.entity;


import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 聊天消息表(ChatMessage)
 *
 * @author why
 * @since 2025-09-23 10:12:42
 */
@Data
@TableName("chat_message")
public class ChatMessage implements Serializable {

    private static final long serialVersionUID = -61732107196808576L;

    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 发送者ID
     **/
    private String senderId;

    /**
     * 接收者ID
     **/
    private String receiverId;

    /**
     * 消息内容
     **/
    private String content;

    /**
     * 消息类型
     **/
    private String messageType;

    /**
     * 是否已读
     **/
    private Integer isRead;

    /**
     * 创建时间
     **/
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 房间ID(群聊)
     **/
    private String roomId;
}



